Repository navigation
feat(upload): --idempotency-key and --dedupe - #21
Merged
Merged
Conversation
--idempotency-key sends the Idempotency-Key header (retry-safe; single file only). --dedupe asks the API to reuse an identical existing image. Both validated up front; combination rejected. Replay/dedup notes go to stderr so stdout stays the bare URL. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Exposes the API's retry-safety and content-reuse options (pixelvault#335) on
pixelvault upload:--idempotency-key <key>→Idempotency-Keyheader. Repeating the same key with the same file returns the original image (API: 200,replayed: true). Single file only: one key can't cover several different files.--dedupe→dedupe=true. The API reuses an identical image already in the project and doesn't count another upload.Both are validated before any file is read;
--dedupe+--idempotency-keyis rejected (mirrors the API's 400). A "Replayed" / "Deduplicated" note goes to stderr, so stdout remains the bare URL and existing scripts are unaffected.Not in this PR
Version bump / release. I'd cut it as 0.9.0 in a separate
chore: releasecommit +v0.9.0tag, as with 0.8.0. The skill doc should merge only after that publish.Test plan
tsc --noEmit, 78 tests (new:validateReuseOptionsfor key shape, combo, multi-file)pixelvault upload a.png --idempotency-key smoke-1twice should print the same URL, with "Replayed" the second time🤖 Generated with Claude Code